--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Commit 38bbf194219c4b1ac9393ea281de42551a4d2d8b
Parents : 776e72d
Author : Mark Qvist <mark@unsigned.io>
Date : 2021-12-01T19:28:19+01:00
Error handling
Changes
Diff
diff --git a/LXMF/LXMF.py b/LXMF/LXMF.py
index f199d01..040a551 100644
--- a/LXMF/LXMF.py
+++ b/LXMF/LXMF.py
@@ -1565,7 +1565,11 @@ class LXMRouter:
for peer in culled_peers:
RNS.log("Removing peer "+RNS.prettyhexrep(peer)+" due to excessive unreachability", RNS.LOG_WARNING)
- self.peers.pop(peer_id)
+ try:
+ # TODO: Check this and add "if in" clause
+ self.peers.pop(peer_id)
+ except Exception as e:
+ RNS.log("Error while removing peer "+RNS.prettyhexrep(peer_id)+". The contained exception was: "+str(e), RNS.LOG_ERROR)
def fail_message(self, lxmessage):
@@ -1707,4 +1711,4 @@ class LXMRouter:
else:
RNS.log("Max delivery attempts reached for propagated "+str(lxmessage)+" to "+RNS.prettyhexrep(lxmessage.get_destination().hash), RNS.LOG_DEBUG)
- self.fail_message(lxmessage)
\ No newline at end of file
+ self.fail_message(lxmessage)
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────